@extends('host.common.common')
@section('head')
    <script>
        var PAGE_DATA = {
            logo : "/assets/b2b/css/images/b2b-web-logo.png",
            modalCategoryData: undefined,
            modalBrandData : undefined,
            actionUrlB : "{{ route('register.purchaser') }}",
            actionUrlS : "{{ route('register.provider') }}",
            countyData : [
                {code:"100", text: "中国"},
                {code:"101", text: "美国"}
            ],
            provinceData : [
                {code:"200", text: "北京市"},
                {code:"201", text: "重庆市"},
                {code:"202", text: "云南省"}
            ],
            cityData : [
                {code:"300", text: "成都市"},
                {code:"301", text: "昆明市"},
                {code:"302", text: "aa区"}
            ],
            supplyAgreementUrl : "{{route('industry.comm',["rzxy", '94'])}}",

        };

    </script>
    @stop

    @section('body')
            <!-- top_test -->
    <div id="top_test"> </div>

    <div class="com-w" >
        <div class="wrapper clearfix">
            <div class="fl">
                <a href="{{route('host')}}">
                    <img id="web-logo" src="" />
                </a>
            </div>
            <div class="fr ">
                <a href="{{route('host')}}">
                    <img src="/assets/b2b/css/images/d-code.jpg " class="mt15"></a>
                <div class="c-coffee tc mt5">APP下载</div>
            </div>
        </div>
    </div>

    <form id="mainform" action="{{'register.purchaser'}}" method="post" enctype="multipart/form-data" >
        @if(count($errors) > 0)
            @foreach($errors->all() as $error)
                <p>{{ $error }}</p>
                @endforeach
                @endif
                {{ csrf_field() }}
                        <!-- 账户信息 -->
                <div class="com-w ">
                    <div class="wrapper clearfix">
                        <div class="info-box-title">
                            <i class="icon-user"></i>
                            <span>填写账户信息</span>
                        </div>
                    </div>
                </div>


                    <div class="com-w">
                        <div class="wrapper  comm-border-d clearfix" style="width: 1198px;background-color: #fff">
                            <div class="comm-regist-info-line mt30">
                                <div class="key-lbl">
                                    <span class="f-red">*</span>
                                    <label for="user">用户名 :</label>
                                </div>
                                <div class="input-info">
                                    <input id="user" name="user" type="text" value="{{ old('user') }}"/>
                                </div>
                            </div>


                            <div class="comm-regist-info-line">
                                <div class="key-lbl">
                                    <span class="f-red">*</span>
                                    <label for="password">密码 :</label>
                                </div>
                                <div class="input-info">
                                    <input id="password" name="password" type="password" />
                                </div>
                            </div>

                            <div class="comm-regist-info-line">
                                <div class="key-lbl">
                                    <span for="password">密码强度 :</span>
                                </div>
                                <div class="input-info" id="pw-level">
                                    <!-- pw-strength-chk -->
                                    <div class="pw-strength-def pw-1 ">弱</div>
                                    <div class="pw-strength-def pw-2 ">中</div>
                                    <div class="pw-strength-def pw-3 ">强</div>
                                    <input type="hidden" name="pwStrength" id="pwStrength" />
                                </div>
                            </div>

                            <div class="comm-regist-info-line">
                                <div class="key-lbl">
                                    <span class="f-red">*</span>
                                    <label for="password_confirmation">确认密码 :</label>
                                </div>
                                <div class="input-info">
                                    <input id="password_confirmation" name="password_confirmation" type="password" />
                                </div>
                            </div>


                            <div class="comm-regist-info-line mt10">
                                <div class="key-lbl">
                                    <span class="f-red">*</span>
                                    <label for="email">电子邮箱 :</label>
                                </div>
                                <div class="input-info">
                                    <input id="email" name="email" type="text" value="{{ old('email') }}" />
                                </div>
                            </div>

                        </div>
                    </div>

                    <!-- 供应商基本信息 -->

                    <div class="com-w mt20">
                        <div class="wrapper clearfix">
                            <div class="info-box-title">
                                <i class="icon-pencil"></i>
                                <span>采购商基本信息</span>
                            </div>
                        </div>
                    </div>
                    <div class="com-w mt10">
                        <div class="wrapper comm-border-d clearfix" style="width: 1198px;background-color: #fff">
                            <div class="comm-regist-info-line mt30">
                                <div class="key-lbl">
                                    <span class="f-red">*</span>
                                    <label for="company">公司全称 :</label>
                                </div>
                                <div class="input-info">
                                    <input id="company" name="company" type="text" value="{{ old('company') }}"/>
                                </div>
                            </div>

                            <div class="comm-regist-info-line mt10">
                                <div class="key-lbl">
                                    <span class="f-red">*</span>
                                    <label for="legal">法人 :</label>
                                </div>
                                <div class="input-info">
                                    <input id="legal" name="legal" type="text" value="{{ old('legal') }}"/>
                                </div>
                                <div class="input-info">
                                    <label for="gender-1" class="lh32">
                                        <input id="gender-1" name="legal_gender" type="radio" value="1" />
                                        先生
                                    </label>
                                    <label for="gender-0" class="lh32">
                                        <input id="gender-0" name="legal_gender" type="radio" value="0" />
                                        女士
                                    </label>
                                </div>
                            </div>

                            <div class="comm-regist-info-line mt10" style="display: none">
                                <div class="key-lbl">
                                    <span class="f-red">*</span>
                                    <label for="gender-0">性别 :</label>
                                </div>
                                <div class="input-info">
                                    <label for="gender-1" class="lh32">
                                        <input id="gender-1" name="legal_gender" type="radio" value="1" checked="'checked"/>
                                        先生
                                    </label>
                                    <label for="gender-0" class="lh32">
                                        <input id="gender-0" name="legal_gender" type="radio" value="0" />
                                        女士
                                    </label>
                                </div>
                            </div>

                            <div class="comm-regist-info-line mt10">
                                <div class="key-lbl">
                                    <span class="f-red">*</span>
                                    <label for="identification_number">法人身份证 :</label>
                                </div>
                                <div class="input-info">
                                    <input id="identification_number" name="identification_number" type="text" value="{{ old('identification_number') }}" />
                                </div>
                            </div>
                            <div class="comm-regist-info-line mt10">
                                <div class="key-lbl">
                                    <span class="f-red">*</span>
                                    <label for="contact_person">联系人姓名 :</label>
                                </div>
                                <div class="input-info">
                                    <input id="contact_person" name="contact_person" type="text" value="{{ old('contact_person') }}" />
                                </div>
                            </div>
                            <div class="comm-regist-info-line mt10">
                                <div class="key-lbl">
                                    <span class="f-red">*</span>
                                    <label for="contact_phone">联系人电话 :</label>
                                </div>
                                <div class="input-info">
                                    <input id="contact_phone" name="contact_phone" type="text" value="{{ old('contact_phone') }}" />
                                </div>
                            </div>

                            <div class="comm-regist-info-line mt10">
                                <div class="key-lbl">
                                    <span class="f-red">*</span>
                                    <label for="companyAddr">公司地址 :</label>
                                </div>
                                <div class="input-info">
                                    <select id="province" name="province">
                                        <option value="">请选择</option>
                                    </select>
                                    <select id="city" name="city">
                                        <option value="">请选择</option>
                                    </select>
                                    <select id="country" name="county">
                                        <option value="">请选择</option>
                                    </select>
                                </div>
                            </div>

                            <div class="comm-regist-info-line mt10">
                                <div class="key-lbl">
                                    <span class="f-red">*</span>
                                    <label for="address">详细地址 :</label>
                                </div>
                                <div class="input-info">
                                    <input id="address" name="address" type="text" value="{{ old('address') }}" />
                                </div>
                            </div>

                            <div class="comm-regist-info-line mt10 comm-regist-line-h60" style="display:none">
                                <div class="key-lbl" >
                                    <span class="f-red">*</span>
                                    <label for="captcha">验证码 :</label>
                                </div>

                                <div class="input-info" style="position: relative;top: 15px;min-width: 100px!important;height: 30px;">
                                    <input id="captcha" name="captcha" type="text" style="width: 100px; float: left;" />
                                    <div style="position: relative;border: 1px solid #ccc;height: 30px;float: left;width: 100px;margin-left: 10px;">
                                        <img id="captchaimg" src="{{ route('captcha.generate') }}" onclick="this.src='{{ route('captcha.generate') }}?v=' + Math.random() * 10"/>
                                    </div>

                                </div>

                            </div>


                        </div>
                    </div>

                    <!-- 电子文件 -->
                    <div class="com-w mt20">
                        <div class="wrapper clearfix">
                            <div class="info-box-title">
                                <i class="icon-print"></i>
                                <span>电子文件</span>
                            </div>
                        </div>
                    </div>
                    <div class="com-w">

                        <div class="wrapper  comm-border-d clearfix electronic" style="height:580px">

                            <div class="regist-role" id="regist-role">
                            </div>

                            <div class="upload-image clearfix" id="regist-elec-docs">
                                <div class="image-list" id="aa">
                                    <div class="img">
                                        <img src="" />
                                    </div>
                                    <div class="img-text">
                                        身份证（正面）
                                    </div>
                                    <input type="file" style="display: none;" name="legal_identity_a" id="legal_identity_a" />
                                </div>
                                <div class="image-list">
                                    <div class="img">
                                        <img src="" />
                                    </div>
                                    <div class="img-text">
                                        身份证（反面）
                                    </div>
                                    <input type="file" style="display: none;" name="legal_identity_b" id="legal_identity_b" />
                                </div>
                                <div class="image-list">
                                    <div class="img">
                                        <img src="" />
                                    </div>
                                    <div class="img-text">
                                        营业执照副本
                                    </div>
                                    <input type="file" style="display: none;" name="business_license" id="business_license" />
                                </div>

                                <div class="image-list  ">
                                    <div class="img">
                                        <img src="" />
                                    </div>
                                    <div class="img-text">
                                        税务登记证
                                    </div>
                                    <input type="file" style="display: none;" name="tax_registration" id="tax_registration" />
                                </div>

                                <div class="image-list  ">
                                    <div class="img">
                                        <img src="" />
                                    </div>
                                    <div class="img-text">
                                        组织机构代码证
                                    </div>
                                    <input type="file" style="display: none;" name="organization_code_cert" id="organization_code_cert" />
                                </div>

                                <div class="electronic-prompt">提示：每张图片大小不超过2M，支持png、jpg、gif、bmp格式文件</div>
                            </div>
                            <div class="electronic-bottom">
                                <label for="signflag ">
                        <span class="electronic-bottom-l ">
                            <input id="signflag" type="radio" name="signflag" style="margin-left: 260px;margin-top: 20px;" />
                        </span>
                                    <label for="signflag lh50">我已阅读并接受</label>
                        <span id="agreement-file ">
                            <a id="supply-agreement" class="coofee-shop lh50" href="" style="color: #f40003">《咖啡商谷供销平台采购商入驻协议》</a>

                        </span>
                                </label>
                            </div>
                            <div class="clearfix mt30 mb75 tc">
                                <input id="form-submit-btn" class="btn btn-important btn-w200x50 lh35 f16" type="submit" value="提交申请"></input>
                            </div>
                        </div>
                    </div>
                <div style="display: none" role="1" id="regist_classly"></div>
    </form>

                <!-- foot_nav -->
                <div id="foot_nav"> </div>
                <div id="bottom_main"> </div>

                <!-- template -->

                <script type="text/template" id="item-template">

                    <div class='dialog-div'>
                        <div class='regist-left-box mr10'>
                            <% var tmpIdx = 0; %>
                            <% _.each(obj, function(item){%>
                            <div class='info-item' id='info-item-title-<%=tmpIdx %>' >
                                <div class='content-box'>
                                    <%=item.categTitle%>
                                </div>
                                <div class='icon-box'>
                                    <i class='icon-angle-right'></i>
                                </div>
                            </div>
                            <% tmpIdx++ %>
                            <% });%>

                        </div>
                        <div class='regist-right-box'>
                            <% var tmpIdx2=0 %>
                            <% var tmpIdx3=0 %>
                            <% _.each(obj, function(item){ %>
                            <div class="info-detail-box" id="info-detail-box-<%=tmpIdx2%>">
                                <% _.each(item.categDetail, function(itemDetail){%>
                                <label for="detail-item-<%=tmpIdx3%>">
                                    <input id="detail-item-<%=tmpIdx3%>" type="checkbox"
                                           code="<%=itemDetail.code%>" txt="<%=itemDetail.txt%>" /><%=itemDetail.txt%>
                                </label>
                                <% tmpIdx3++ %>
                                <% });%>
                            </div>
                            <% tmpIdx2++ %>
                            <% });%>

                        </div>
                        <div>
                            <div id="modal-save-btn" class="btn btn-warn btn-w70x30 fr mt10 mb10">保存</div>
                        </div>
                    </div>

                </script>

                <script type="text/template" id="sel-item-templ">
                    <% _.each(obj, function(item){%>
                    <div class="sel-item"><%=item %>
                    </div>
                    <% });%>
                </script>

                <script type="text/template" id="addr-option-templ">
                    <option value="">请选择</option>
                    <% _.each(obj, function(item){%>
                    <option value="<%=item.code %>"><%=item.text %></option>
                    <% }); %>
                </script>

                <!-- JS -->

                <script src="/assets/b2b/js/libs/jquery.validate.min.js"></script>
                <script src="/assets/b2b/js/libs/underscore-min.js"></script>

                <script src="/assets/b2b/js/libs/messages_zh.js"></script>
                <script src="/assets/b2b/js/libs/dialog-min.js"></script>
                <script src="/assets/b2b/js/libs/jquery.ajaxfileupload.js"></script>

                <script src="/assets/b2b/js/libs/page/template-util.js"></script>
                <script src="/assets/b2b/js/libs/mockTest/jquery.mockjax.min.js"></script>
                <script src="/assets/b2b/js/pageModules/buyer/regist.js"></script>

@stop
